/**
 * Created by jianhuang on 2015/1/9.
 */
define(['jquery','underscore','template','helper/utils','text!text_path/hello.tpl'],
    function ($,_,template,Utils,hello) {
        function IndexPage() {
        }

        IndexPage.prototype.bindEvent=function(){
            var t=this;
            $("#man").on("click",function(){
                console.log($(this).html());
            });
        };

        IndexPage.prototype.renderPage=function(){
            var t=this;
            t.templateText();
        };

        IndexPage.prototype.templatePage=function(){
            var data={"msg":"hello world template"};
            var res=template("templateMsg",data);
            Utils.trace(res);
        };

        IndexPage.prototype.templateText=function(){
            var compiled = _.template(hello);
            var data=compiled({name:'jian'});
            $("#demo").html(data);
        };

        IndexPage.prototype._init = function () {
            var t = this;
            this.renderPage();
            this.bindEvent();
        };

        IndexPage.prototype.render = function () {
            this._init();
        };

        return IndexPage;
    }
);